﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace SYH.Config
{
    public class WebConfig
    {
        public static string GetApp(string key)
        {
            return ConfigurationManager.AppSettings[key];
        }
        static string GetConnection(string key)
        {
            return ConfigurationManager.ConnectionStrings[key].ConnectionString;
        }

        #region 数据库连接字符串
        /// <summary>
        /// 链接字符串
        /// </summary>
        public static string SqlConnString
        {
            get
            {
                return GetApp("SqlConnString");
            }
        }
        #endregion

        #region 脚本路径
        /// <summary>
        /// 脚本所在目录
        /// </summary>
        public static string ScriptRootPath
        {
            get { return GetApp("ScriptRootPath"); }
        }
        /// <summary>
        /// 样式所在目录
        /// </summary>
        public static string StyleRootPath
        {
            get { return GetApp("StyleRootPath"); }
        }
        #endregion

        #region  邮箱配置
        /// <summary>
        /// 邮箱主机名
        /// </summary>
        public static string EmailHost
        {
            get
            {
                return GetApp("EmailHost");
            }
        }

        /// <summary>
        /// 邮箱端口号
        /// </summary>
        public static string EmailPort
        {
            get
            {
                return GetApp("EmailPort");
            }
        }

        /// <summary>
        /// 发送邮箱账号
        /// </summary>
        public static string EmailName
        {
            get
            {
                return GetApp("EmailName");
            }
        }

        /// <summary>
        /// 邮箱密码
        /// </summary>
        public static string EmailPass
        {
            get
            {
                return GetApp("EmailPass");
            }
        }
        #endregion

        #region 短信配置
        /// <summary>
        /// 发送短信账号
        /// </summary>
        public static string SmsName
        {
            get
            {
                return GetApp("SmsName");
            }
        }

        /// <summary>
        /// 短信密码
        /// </summary>
        public static string SmsPass
        {
            get
            {
                return GetApp("SmsPass");
            }
        }
        #endregion
    }
}
